Las Reliquias de Tolti Aph

An interactive fiction by Graham Nelson (2005) - the Inform 7 source text

Home page

Contents
Previous
Next

Complete text
Section E(s) - Trampas y terremotos

[ El original "Sorcerer's Cave" de Donnelly tenía cuatro peligros, siendo los otros Medusa y Motín, pero ninguno funciona bien para un juego jugado por un sólo personaje en vez de un "equipo" de exploradores. Trampa y Terremoto están en esencia sin cambiar desde el original.]

Hazard-playing is an action out of world applying to one thing.

Every turn:
    let the locale be the location;
    repeat with hazard card running through hazards in the locale
    begin;
        try hazard-playing the hazard card;
    end repeat.

To make the player fall to (destination - room):
    if the destination is unvisited, draw cards for the destination;
    move the player to the destination.

Carry out hazard-playing a Trap:
    return the noun to the pack;
    let the position below be the vector sum of the grid position of the location and the vector of down;
    if the position below is <0,0,0>, continue the action;
    if the location is descending, continue the action;
    let the place below be the room at the position below;
    if the place below is not Solid Rock
    begin;
        say "Caes a través de una trampa oculta en el suelo, emergiendo en...";
        change the down exit of the location to the place below;
        make the player fall to the place below;
        stop;
    end if;
    if a labyrinth room (called the place below) is unplaced
    begin;
        say "¡Caes por una trampa oculta en el suelo!";
        position the place below at the position below;
        change the down exit of the location to the place below;
        if the place below is not ascending,
            change the up exit of the place below to Solid Rock;
        make the player fall to the place below;
    end if.

A room can be Earthquake-damaged or Earthquake-undamaged. A room is usually not Earthquake-damaged. Instead of going to an Earthquake-damaged room, say "Toda esa cueva se ha colapsado por un terremoto y es ahora intransitable."

Carry out hazard-playing an Earthquake:
    return the noun to the pack;
    if the previous location is not a labyrinth room, continue the action;
    if the previous maze level is 1, continue the action;[1]
    if the player is in the previous location, continue the action;
    say "¡Un violento terremoto causa el derrumbe de grandes rocas en la cueva detrás tuya!";
    now the previous location is Earthquake-damaged.



Note

[1]. Un Terremoto causa que rocas caigan para bloquear la habitación que acabamos de abandonar: lo cual no tiene mucho sentido en el laberinto ajardinado del nivel 1.